home *** CD-ROM | disk | FTP | other *** search
/ Interactive Preview: Enemy of the State / Interactive Preview: Enemy of the State.iso / pc / alrtthis.dxr / 00013_AskThisC Script.ls < prev    next >
Encoding:
Text File  |  1998-11-18  |  3.4 KB  |  134 lines

  1. on askThisCEXT message, btn1, btn2, btn3, cmd1, cmd2, cmd3
  2.   global alertWin, gDefaultButton
  3.   tell alertWin
  4.     put EMPTY into field "AskCmd1"
  5.   end tell
  6.   tell alertWin
  7.     put EMPTY into field "AskCmd2"
  8.   end tell
  9.   tell alertWin
  10.     put EMPTY into field "AskCmd3"
  11.   end tell
  12.   if not voidp(cmd1) then
  13.     put cmd1 into field "AskCmd1"
  14.   end if
  15.   if not voidp(cmd2) then
  16.     put cmd2 into field "AskCmd2"
  17.   end if
  18.   if not voidp(cmd3) then
  19.     put cmd3 into field "AskCmd3"
  20.   end if
  21.   if not voidp(message) then
  22.     put message into field "AskMessage"
  23.   end if
  24.   updateStage()
  25.   set msgV to the height of member "AskMessage"
  26.   set winV to 7 + msgV + 45
  27.   if winV < 80 then
  28.     set winV to 80
  29.   end if
  30.   set x to 400
  31.   set y to winV
  32.   tell the stage
  33.     set the rect of alertWin to getCenteredRect(x, y)
  34.   end tell
  35.   repeat with p = 1 to 10
  36.     puppetSprite(p, 0)
  37.   end repeat
  38.   updateStage()
  39.   go("AskThisC")
  40.   repeat with m in [2, 4, 6]
  41.     set the visible of sprite m to 1
  42.     puppetSprite(m, 1)
  43.     set the locV of sprite m to winV - 18
  44.     updateStage()
  45.   end repeat
  46.   repeat with m in [3, 5, 7]
  47.     set the visible of sprite m to 0
  48.     puppetSprite(m, 1)
  49.     set the locV of sprite m to winV - 18
  50.     updateStage()
  51.   end repeat
  52.   repeat with m = 8 to 10
  53.     set the visible of sprite m to 1
  54.     puppetSprite(m, 1)
  55.     set the locV of sprite m to winV - 26
  56.     updateStage()
  57.   end repeat
  58.   set gDefaultButton to "1"
  59.   set the memberNum of sprite 2 to the number of member "lrg def btn"
  60.   set the memberNum of sprite 4 to the number of member "sml btn"
  61.   set the memberNum of sprite 6 to the number of member "sml btn"
  62.   updateStage()
  63.   if not voidp(btn1) then
  64.     if the number of chars in btn1 > 16 then
  65.       repeat while the number of chars in btn1 > 15
  66.         delete char -30000 of btn1
  67.       end repeat
  68.       set theLastChar to the number of chars in btn1
  69.       put "..." after char theLastChar of btn1
  70.     end if
  71.   end if
  72.   if voidp(btn2) = 0 then
  73.     if the number of chars in btn2 > 12 then
  74.       repeat while the number of chars in btn2 > 11
  75.         delete char -30000 of btn2
  76.       end repeat
  77.       set theLastChar to the number of chars in btn2
  78.       put "..." after char theLastChar of btn2
  79.     end if
  80.   end if
  81.   if voidp(btn3) = 0 then
  82.     if the number of chars in btn3 > 12 then
  83.       repeat while the number of chars in btn3 > 11
  84.         delete char -30000 of btn3
  85.       end repeat
  86.       set theLastChar to the number of chars in btn3
  87.       put "..." after char theLastChar of btn3
  88.     end if
  89.   end if
  90.   if voidp(btn1) or (btn1 = EMPTY) then
  91.     set btn1 to "OK"
  92.   end if
  93.   set the text of member "AskBtn1" to btn1
  94.   updateStage()
  95.   if voidp(btn2) or (btn2 = EMPTY) then
  96.     repeat with i in [4, 5, 9]
  97.       set the visible of sprite i to 0
  98.     end repeat
  99.   else
  100.     set the text of member "AskBtn2" to btn2
  101.   end if
  102.   updateStage()
  103.   if voidp(btn3) or (btn3 = EMPTY) then
  104.     repeat with i in [6, 7, 10]
  105.       set the visible of sprite i to 0
  106.     end repeat
  107.   else
  108.     set the text of member "AskBtn3" to btn3
  109.   end if
  110.   updateStage()
  111.   tell the stage
  112.     playAsk()
  113.   end tell
  114.   updateStage()
  115.   if the machineType = 256 then
  116.     tell the stage
  117.       set the windowType of alertWin to 1
  118.     end tell
  119.   else
  120.     tell the stage
  121.       set the windowType of alertWin to 1
  122.     end tell
  123.   end if
  124.   tell the stage
  125.     set the modal of alertWin to 1
  126.   end tell
  127.   tell the stage
  128.     open(alertWin)
  129.   end tell
  130.   tell the stage
  131.     return EMPTY
  132.   end tell
  133. end
  134.